package com.ys.shardingjdbcdemo.goods.sharding;

import com.google.common.collect.Range;
import org.apache.shardingsphere.api.sharding.standard.RangeShardingAlgorithm;
import org.apache.shardingsphere.api.sharding.standard.RangeShardingValue;
import org.springframework.stereotype.Component;

import java.util.Collection;

/**
 * @program: sharding-jdbc-demo
 * @description: 范围查找分库路由算法
 * @author: Henry
 * @create 2020-06-07 20:20
 **/
@Component
public class RangeShardingDatabaseAlgorithm implements RangeShardingAlgorithm<Long> {
    @Override
    public Collection<String> doSharding(Collection<String> collection, RangeShardingValue<Long> rangeShardingValue) {
        return collection;
    }
}
